import { request } from "./utils";

export function listRoomTypesPrice(query: PriceRulePageQueryDTO) {
  return request({
    url: "/hotel/roomTypes/specialPrice",
    method: "get",
    params: query
  });
}

export function updateRoomTypesPrice(data: RoomTypesPriceDTO) {
  return request({
    url: "/hotel/roomTypes/updateSpecialPrice",
    method: "put",
    data: data
  });
}

export function addRoomTypes(data: RoomTypesPriceDTO) {
  return request({
    url: "/hotel/roomTypes/addSpecialPrice",
    method: "post",
    data: data
  });
}
export function switchRoomStatus(data: RoomTypesPriceDTO) {
  return request({
    url: "/hotel/roomTypes/specialPriceStatus",
    method: "put",
    data: data
  });
}
export function getRoomPriceById(id: number) {
  return request({
    url: "/hotel/roomTypes/specialPrice/" + id,
    method: "get"
  });
}

interface RoomTypesPriceDTO {
  id?: number;
  name?: string;
  specialPrice?: number;
  firstPrice?: number;
  secondPrice?: number;
  dateType?: string;
}
interface PriceRulePageQueryDTO {
  pageNum: number;
  pageSize: number;
  dateType: string;
  name: string;
}
export type { RoomTypesPriceDTO, PriceRulePageQueryDTO };
